<template>
  <div id="homeswiper">
    <swiper :moveRatio="0.05">
      <swiper-item v-for="item in  banners">
        <a :href="item.link">
          <img :src="item.image" :alt="item.title" @load="swiperover"/>
        </a>
      </swiper-item>
    </swiper>
  </div>
</template>

<script>
import { Swiper, SwiperItem } from "components/common/swiper/index";
export default {
  name: "home",
  components: {
    Swiper,
    SwiperItem
  },
  data() {
    return {
      isload : true
    };
  },
  props: {
    banners: {
      type: Array,
      default: []
    }
  },methods: {
    //这是获取到四张轮播图是否轮播完 轮播完成的话就把轮播返回
    swiperover(){
      if(this.isload){
        //只让他发送一次
        console.log("我已经轮播完了")
      this.$emit("swiperover")
      this.isload = false;
      }
      
    }
  },
};
</script>

<style>
</style>